include( 'shared.lua' )
include( "cl_hud.lua" )
include("cl_scoreboard.lua")
AudioClips = {}
AudioClips[1]="ambient/alarms/warningbell1.wav" 
AudioClips[2]="ambient/alarms/razortrain_horn1.wav"
AudioClips[3]="HL1/fvox/bell.wav"
AudioClips[4]="hw/winv2.wav"
AudioClips[5]="hw/lose.wav"
currentWave = 0
totalnpcs = 0
function GM:PostDrawViewModel( vm, ply, weapon )

  if ( weapon.UseHands || !weapon:IsScripted() ) then
    local hands = LocalPlayer():GetHands()
    if ( IsValid( hands ) ) then hands:DrawModel() end

  end

end
function updatewave( data )
	currentWave = data:ReadLong() 
end
function NpcChange( data )
	totalnpcs = data:ReadString() 
end
usermessage.Hook("WaveChange", updatewave)
usermessage.Hook("NpcChange", NpcChange)
function drawsomething() 
        render.SetMaterial( Material( "sprites/blueglow2" ) )
        render.DrawQuadEasy( Vector(20,20,80),    --position of the rect
        Vector(50,50,80),        --direction to face in
        528, 528,              --size of the rect
        Color( 255, 255, 255, 255 ),  --color
        90                     --rotate 90 degrees
        ) 

end

function clintAudio(ply,cn,track)
surface.PlaySound( AudioClips[tonumber(track[1])] )
end
concommand.Add( "playaudio", clintAudio )
concommand.Add( "draw", drawsomething )
local user = LocalPlayer()
width = ScrW()
height = ScrH()

function set_team()
 
local frame = vgui.Create( "DFrame" )
frame:SetPos( ScrW() / 2, ScrH() / 2 ) --Set the window in the middle of the players screen/game window
frame:SetSize( 200, 210 ) --Set the size
frame:SetTitle( "Change Team" ) --Set title
frame:SetVisible( true )
frame:SetDraggable( false )
frame:ShowCloseButton( true )
frame:MakePopup()
 
team_1 = vgui.Create( "DButton", frame )
team_1:SetPos( frame:GetTall() / 2, 5 ) --Place it half way on the tall and 5 units in horizontal
team_1:SetSize( 50, 100 )
team_1:SetText( "Team 1" )
team_1.DoClick = function() --Make the player join team 1
    RunConsoleCommand( "team_1" )
end
 
team_2 = vgui.Create( "DButton", frame )
team_2:SetPos( frame:GetTall() / 2, 105 ) --Place it next to our previous one
team_2:SetSize( 50, 100 )
team_2:SetText( "Team 2" )
team_2.DoClick = function() --Make the player join team 2
    RunConsoleCommand( "team_2" )
end
 
end
concommand.Add( "team_menu", set_team )
function GamMsg(UMsg)
print("Doing this")
	chat.AddText( Color(0,120,0), "[HW] ", Color(255, 255, 255), UMsg:ReadString())
end
usermessage.Hook("GameMsg", GamMsg)

